/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.tfb.users;

/**
 *
 * @author Ilija
 */
public class User {
    private static int userCounter=0;
    private int id;
    private String username;
    private String password;
    private String firstName;
    private String lastName;
    private String email;

    public User(String username, String password, String firstName, String lastName, String email) {
        this.username = username;
        this.password = password;
        this.firstName = firstName;
        this.lastName = lastName;
        this.email = email;
        id=userCounter++;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public boolean equals(Object obj) {
        if(obj instanceof User){
           User outter = (User)obj;
           return username.equals(outter.username);
        }
        return false;
    }
  
    @Override
    public int hashCode() {
        return username.hashCode();
    }



}
